<?php
function init_roles()
{
	$acl = new Zend_Acl();
	//echo $this->auth->getUserGroup();
		
	$acl->add(new Zend_Acl_Resource('notifications'));
	$acl->add(new Zend_Acl_Resource('countries'));	
	$acl->add(new Zend_Acl_Resource('states'));
	$acl->add(new Zend_Acl_Resource('regions'));	
	$acl->add(new Zend_Acl_Resource('cities'));
	$acl->add(new Zend_Acl_Resource('districts'));			
	$acl->add(new Zend_Acl_Resource('pages'));	
	$acl->add(new Zend_Acl_Resource('homepage'));
	$acl->add(new Zend_Acl_Resource('users'));
	$acl->add(new Zend_Acl_Resource('email'));	
	$acl->add(new Zend_Acl_Resource('reports'));
	$acl->add(new Zend_Acl_Resource('contributors'));
	$acl->add(new Zend_Acl_Resource('user'));
    $acl->add(new Zend_Acl_Resource('blog'));
	$acl->add(new Zend_Acl_Resource('marketplace'));
	$acl->add(new Zend_Acl_Resource('credit_cards'));	
	$acl->add(new Zend_Acl_Resource('billing'));
	$acl->add(new Zend_Acl_Resource('tests'));
	$acl->add(new Zend_Acl_Resource('questions'));
	$acl->add(new Zend_Acl_Resource('faq'));
	$acl->add(new Zend_Acl_Resource('inbox'));
	$acl->add(new Zend_Acl_Resource('schedule'));	
	$acl->add(new Zend_Acl_Resource('candidate'));
	$acl->add(new Zend_Acl_Resource('search'));
    
	$acl->addRole(new Zend_Acl_Role('Guest'));
	$acl->addRole(new Zend_Acl_Role('User'));
	$acl->addRole(new Zend_Acl_Role('Journalist'));
	
	$User_Allow = array('countries', 'states', 'regions', 'cities', 'districts', 'marketplace', 'pages', 'homepage', 'contributors', 'email', 'reports', 'users', 'user', 'blog','credit_cards', 'billing', 'tests', 'questions', 'schedule', 'candidate', 'faq', 'search');
	$acl->allow('User', $User_Allow);

	$Journalist_Allow = array('countries', 'states', 'regions', 'cities', 'districts', 'marketplace', 'pages', 'homepage', 'contributors', 'email', 'reports', 'users', 'user', 'blog','credit_cards', 'billing', 'tests', 'questions', 'schedule', 'candidate', 'faq', 'search');
	$acl->allow('Journalist', $Journalist_Allow);
	
	$Guest_Allow = array('homepage');
	
	$acl->allow('Guest', 'search', 'index');
	$acl->allow('Guest', 'search', 'rating');
	$acl->allow('Guest', 'pages', 'news');
	$acl->allow('Guest', 'pages', 'book_info');
	$acl->allow('Guest', 'pages', 'view');
	$acl->allow('Guest', 'states', 'loadStatesByCountryId');
	$acl->allow('Guest', 'cities', 'loadCitiesByStateId');
	$acl->allow('Guest', 'cities', 'search_autocomplete');
	$acl->allow('Guest', 'user', 'login');
	$acl->allow('Guest', 'user', 'registration');
	$acl->allow('Guest', 'user', 'email_verification');
	$acl->allow('Guest', 'user', 'contact_us');	
	$acl->allow('Guest', 'user', 'password_forgot');
	$acl->allow('Guest', 'user', 'reset_password');
	//$acl->allow('Guest', 'user');
    $acl->allow('Guest', 'blog');
	$acl->allow('Guest', 'faq');
	$acl->allow('Guest', 'inbox');
	//$acl->deny('Guest', 'user', 'user_profile');	
	$acl->allow('Guest', 'billing');	
	//$acl->allow('Guest', 'marketplace', 'index');
	$acl->allow('Guest', 'homepage', 'index');
    $acl->allow('Guest', 'blog', 'index');
	$acl->allow('Guest', 'candidate');
	$acl->allow('Guest', $Guest_Allow);

	return $acl;
}
?>